/*
 * This file is part of Aion Core <aioncore.com>.
 *
 *  aion-emu is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  aion-emu is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with Aion Core.  If not, see <http://www.gnu.org/licenses/>.
 */

package com.aionemu.gameserver.model.gameobjects.stats.modifiers;

import com.aionemu.gameserver.model.templates.item.WeaponType;
import com.aionemu.gameserver.model.gameobjects.player.Player;

public class CheckWeapon
{
    public static final CheckWeapon getInstance()
    {
        return SingletonHolder.instance;
    }

    public short [] value = new short [1];

    public void WeaponCheck(Player player)
    {
        if (player.getEquipment().getMainHandWeaponType()!=null)
        {
            if (player.getEquipment().getMainHandWeaponType().getRequiredSlots() ==2)
            {
                if( (player.getEquipment().getMainHandWeaponType().equals(WeaponType.TOOLPICK_2H))
                        || (player.getEquipment().getMainHandWeaponType().equals(WeaponType.STAFF_2H)))
                    value[0]= 990;
                if( (player.getEquipment().getMainHandWeaponType().equals(WeaponType.BOOK_2H))
                        || (player.getEquipment().getMainHandWeaponType().equals(WeaponType.ORB_2H)))
                    value[0]= 1090;
                if( (player.getEquipment().getMainHandWeaponType().equals(WeaponType.BOW))
                        || (player.getEquipment().getMainHandWeaponType().equals(WeaponType.SWORD_2H))
                        || (player.getEquipment().getMainHandWeaponType().equals(WeaponType.TOOLROD_2H)))
                    value[0]= 1190;
                if( player.getEquipment().getMainHandWeaponType().equals(WeaponType.POLEARM_2H))
                    value[0]= 1390;
            }
            else
                value[0] = 790;
        }
    }

    public int getValue()
    {
        return value[0];
    }

    @SuppressWarnings("synthetic-access")
    private static class SingletonHolder
    {
        protected static final  CheckWeapon instance = new  CheckWeapon();
    }

}
